package priv.mill;

import java.util.Map;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import priv.haha.MyConfig;
import priv.haha.Person;

public class Main {
	public static void main(String[] args) {
		ApplicationContext context = new AnnotationConfigApplicationContext(MyConfig.class);
		Map<String, Person> beansOfType = context.getBeansOfType(Person.class);
		System.out.println(beansOfType);
		
		Person bean = context.getBean(Person.class);
		System.out.println(bean);
		
		Person bean2 = (Person) context.getBean("person");
		System.out.println(bean2);
	}
}
